package lambda;

/**
 * @author yunfei.shang
 * @title Lambda创建线程
 * @date 2018/03/28
 * @descreption 不使用Lambda表达式与使用Lambda表达式创建线程对比
 */
public class LambdaThreadDemo {
    public static void main(String[] args) {
        Thread thread1 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("thread1");
            }
        });
        thread1.start();
        //lambda
        new Thread(() -> System.out.println("thread2")).start();
    }
}
